# -*- mode: python; -*-

Import("env")
Import("get_option")
Import("http_client")
Import("ssl_provider")

env = env.Clone()

env.CppUnitTest(
    target="util_net_test",
    source=[],
    LIBDEPS=[],
)

env.CppLibfuzzerTest(
    target="asn1_parser_fuzzer",
    source=[
        "asn1_parser_fuzzer.cpp",
    ],
    LIBDEPS=[
        "$BUILD_DIR/mongo/base",
        "$BUILD_DIR/mongo/db/concurrency/lock_manager",
        "$BUILD_DIR/mongo/transport/transport_layer_common",
        "$BUILD_DIR/mongo/util/net/ssl_manager",
    ],
)

if get_option("ssl") == "on":
    env.CppUnitTest(
        target="util_net_ssl_test",
        source=[],
        LIBDEPS=[],
    )

if get_option("ssl") == "on":
    env.CppIntegrationTest(
        target="network_interface_ssl_test",
        source=[
            "network_interface_ssl_test.cpp",
        ],
        LIBDEPS=[
            "$BUILD_DIR/mongo/client/connection_string",
            "$BUILD_DIR/mongo/db/auth/builtin_roles",
            "$BUILD_DIR/mongo/db/auth/user",
            "$BUILD_DIR/mongo/executor/network_interface",
            "$BUILD_DIR/mongo/executor/network_interface_factory",
            "$BUILD_DIR/mongo/executor/network_interface_fixture",
            "$BUILD_DIR/mongo/executor/network_interface_thread_pool",
            "$BUILD_DIR/mongo/executor/thread_pool_task_executor",
            "$BUILD_DIR/mongo/transport/transport_layer_egress_init",
            "$BUILD_DIR/mongo/util/concurrency/thread_pool",
            "$BUILD_DIR/mongo/util/version_impl",
        ],
    )
